package global

import (
	"time"

	"gorm.io/gorm"
)

type GVA_MODEL struct {
	ID        uint           `gorm:"primarykey" json:"ID"` // 主键ID
	CreatedAt time.Time      // 创建时间
	UpdatedAt time.Time      // 更新时间
	DeletedAt gorm.DeletedAt `gorm:"index" json:"-"` // 删除时间
}

// HJ212Data represents a single factor measurement.
type HJ212Data struct {
	GVA_MODEL
	QNTime     time.Time `json:"qn_time"`
	DataTime   time.Time `json:"data_time"`
	MN         string    `json:"mn"`
	ST         uint16    `json:"st"`
	CN         uint16    `json:"cn"`
	FactorCode string    `json:"factor_code"`
	RtdValue   *float64  `json:"rtd_value"` // Use pointer to handle NULL
	Flag       string    `json:"flag"`
}

// TableName 指定表名
func (HJ212Data) TableName() string {
	return "hj212_data"
}
